# $Id: PKGBUILD 88275 2013-04-15 14:47:45Z bgyorgy $
# Maintainer: Ray Rashif <schiv@archlinux.org>
# Contributor: Corrado Primier <bardo@aur.archlinux.org>
# Contributor: Eric Belanger <belanger@astro.umontreal.ca>
# Contributor: Andrew Conkling <andrewski@fr.st>

pkgname=gourmet
pkgver=0.16.0
pkgrel=1
pkgdesc="A simple but powerful recipe-managing application"
arch=(any)
url="http://thinkle.github.com/gourmet/"
license=('GPL')
depends=('pygtk' 'python2-imaging' 'python2-sqlalchemy' 'hicolor-icon-theme')
makedepends=('python2-distutils-extra')
optdepends=('gstreamer0.10-python: play timer sounds'
            'ipython2: Python Shell plugin'
            'pyrtf: RTF support'
            'python2-beautifulsoup3: Webpage import plugin'
            'python2-gtkspell: Spell Checking plugin'
            'python2-poppler: Printing and PDF Export plugin'
            'python2-reportlab: Printing and PDF Export plugin')
changelog=$pkgname.changelog
install=$pkgname.install
source=(https://launchpad.net/gourmet/main/$pkgver/+download/$pkgname-$pkgver.tar.bz2)
md5sums=('6a4ddb80b40e1bee7797697f03c9ef82')

package() {
  cd "$srcdir/$pkgname-$pkgver"

  # python2 fix
  for file in $(find . -name '*.py' -print); do
    sed -i 's_#!/usr/bin/python_#!/usr/bin/python2_' $file
    sed -i 's_#!/usr/bin/env python_#!/usr/bin/env python2_' $file
  done

  python2 setup.py install --root="$pkgdir" --optimize=1
}
